package xdoc;

public class XDocMention {

    String mDocID;
    String mPhrase;
    String mType;
    String mSubType;
    String mAceClass;
        
    public XDocMention(String docID,
                       String phrase,
                       String type,
                       String subType,
                       String aceClass) {
        mDocID = docID;
        mPhrase = phrase;
        mType = type;
        mSubType = subType;
        mAceClass = aceClass;
    }
    public String docId() {
        return mDocID;
    }


    public boolean equals(Object that) {
        if (!(that instanceof XDocMention)) {
            return false;
        }
        XDocMention other = (XDocMention) that;
        return (mention().equals(other.mention()));

    }

    public int hashCode() {
        int result = 17;
        result = 37 * result + mDocID.hashCode();
        result = 37 * result + mPhrase.hashCode();
        return result;
    }

    public String phrase() {
        return mPhrase;
    }

    public String mention() {
        StringBuffer sb = new StringBuffer();
        sb.append(mDocID);
        sb.append(" ");
        sb.append(mPhrase);
        sb.append(" ");
        sb.append(mType);
        sb.append(" ");
        sb.append(mSubType);
        sb.append(" ");
        sb.append(mAceClass);
        return sb.toString();
    }

}
